package com.new4net.exe_stream.meta;

import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;

public interface ExecutionStatement<T> extends Statement<T>{




    <R> ThenStatement<ExecutionStatement<T>,R> _then(String title, Function<ExecutionContext.InstructionContext,R> fun);
    /**
     * 分支
     * @return
     */
     <R> SwitchStatement<ExecutionStatement<T>,R> _switch(String title);


    /**
     * 循环
     * @return 生成新的PromiseStatement
     */
    <R> ExecutionStatement<T> _while(String title, Consumer<ExecutionContext.InstructionContext> consumer, Predicate<ExecutionContext.InstructionContext> predicate, Function<ExecutionContext.InstructionContext,R> fun);

    /**
     * 循环
     * @return 生成新的PromiseStatement
     */
    <R> ExecutionStatement<T>  _do_while(String title, Consumer<ExecutionContext.InstructionContext> consumer, Function<ExecutionContext.InstructionContext,R> fun, Predicate<ExecutionContext.InstructionContext> predicate);




    ParallelStatement<ExecutionStatement<T>> _parallel();



}
